package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.IndsvrBastionAccountMapper;
import com.ruoyi.system.domain.IndsvrBastionAccount;
import com.ruoyi.system.service.IIndsvrBastionAccountService;

/**
 * 堡垒机账户Service业务层处理
 * 
 * @author indsvr
 * @date 2025-07-17
 */
@Service
public class IndsvrBastionAccountServiceImpl implements IIndsvrBastionAccountService 
{
    @Autowired
    private IndsvrBastionAccountMapper indsvrBastionAccountMapper;

    /**
     * 查询堡垒机账户
     * 
     * @param id 堡垒机账户主键
     * @return 堡垒机账户
     */
    @Override
    public IndsvrBastionAccount selectIndsvrBastionAccountById(Long id)
    {
        return indsvrBastionAccountMapper.selectIndsvrBastionAccountById(id);
    }

    /**
     * 查询堡垒机账户列表
     * 
     * @param indsvrBastionAccount 堡垒机账户
     * @return 堡垒机账户
     */
    @Override
    public List<IndsvrBastionAccount> selectIndsvrBastionAccountList(IndsvrBastionAccount indsvrBastionAccount)
    {
        return indsvrBastionAccountMapper.selectIndsvrBastionAccountList(indsvrBastionAccount);
    }

    /**
     * 新增堡垒机账户
     * 
     * @param indsvrBastionAccount 堡垒机账户
     * @return 结果
     */
    @Override
    public int insertIndsvrBastionAccount(IndsvrBastionAccount indsvrBastionAccount)
    {
        indsvrBastionAccount.setCreateTime(DateUtils.getNowDate());
        return indsvrBastionAccountMapper.insertIndsvrBastionAccount(indsvrBastionAccount);
    }

    /**
     * 修改堡垒机账户
     * 
     * @param indsvrBastionAccount 堡垒机账户
     * @return 结果
     */
    @Override
    public int updateIndsvrBastionAccount(IndsvrBastionAccount indsvrBastionAccount)
    {
        indsvrBastionAccount.setUpdateTime(DateUtils.getNowDate());
        return indsvrBastionAccountMapper.updateIndsvrBastionAccount(indsvrBastionAccount);
    }

    /**
     * 批量删除堡垒机账户
     * 
     * @param ids 需要删除的堡垒机账户主键
     * @return 结果
     */
    @Override
    public int deleteIndsvrBastionAccountByIds(Long[] ids)
    {
        return indsvrBastionAccountMapper.deleteIndsvrBastionAccountByIds(ids);
    }

    /**
     * 删除堡垒机账户信息
     * 
     * @param id 堡垒机账户主键
     * @return 结果
     */
    @Override
    public int deleteIndsvrBastionAccountById(Long id)
    {
        return indsvrBastionAccountMapper.deleteIndsvrBastionAccountById(id);
    }
}
